<script setup>
import {onMounted, ref} from "vue";
import {getUserList} from '@/apis/user'
import router from "@/router";

const page = ref(1);
const list = ref([]);
onMounted(() => {
  getUserList(page.value)
      .then(res => {
        const {code, data} = res.data;
        if (code === 1) {
          data.forEach(item => {
            if (item.status === 0) {
              list.value.push(item)
            }
          })
        }
      })
})

function navigationTo(id) {
  router.push({
    name: "member-applyinfo",
    params: {id: id}
  })
}
</script>
<template>
  <main>
    <t-cell-group title="审批列表">
      <t-cell v-if="list.length < 1">暂无数据</t-cell>
      <t-cell v-else @click="navigationTo(item.id)" v-for="item in list" :key="item.id" :title="item.profile.name"
              :note="'申请时间：' + item.create_time"></t-cell>
    </t-cell-group>
  </main>
</template>